package com.runfast.waimai.dao.mapper;

import com.runfast.common.dao.IMapper;
import com.runfast.waimai.dao.model.RunfastGoodsSellRecord;
import com.runfast.waimai.dao.model.RunfastGoodsSellRecordExample;
import org.apache.ibatis.annotations.Mapper;


import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import java.util.Map;


import java.util.Date;
import java.util.List;
import java.util.Map;


@Mapper
public interface RunfastGoodsSellRecordMapper extends IMapper<RunfastGoodsSellRecord, Integer, RunfastGoodsSellRecordExample> {

    RunfastGoodsSellRecord findByShopperIdAndId(@Param("shopperid") Integer shopperid, @Param("userid") Integer userid);

    RunfastGoodsSellRecord findByShopperIdAndOrderCode(@Param("shopperid") Integer shopperid, @Param("ordercode") String ordercode);

    List<RunfastGoodsSellRecord> findById(Integer shopperid);//骑手ID查找

    RunfastGoodsSellRecord findByOrderCode(String ordercode);

 //   PageBean<RunfastGoodsSellRecord> getPageBean4Driver(@Param("pageSize") Integer pageSize, @Param("page") Integer page, @Param("otype") Integer otype, @Param("shopperid") Integer shopperId, @Param("agentid") Integer agentid, @Param("teamid") Integer teamid);

    //  pageSize, page,otype,shopperId,agentId, teamid
    RunfastGoodsSellRecord update(RunfastGoodsSellRecord record);

    List<RunfastGoodsSellRecord> findBymonth(@Param("shopperid") Integer shopperid, @Param("createTime") Date createtime,@Param("createTime1") Date createTime1);

    List<RunfastGoodsSellRecord> findBytime(@Param("createtime") Date createtime, @Param("enddate") Date enddate, @Param("shopperid") Integer shopperid, @Param("page") int page, @Param("rows") int rows, @Param("agentid") Integer agentid);
    List<RunfastGoodsSellRecord> findListPageBean(@Param("pageSize") Integer pageSize, @Param("page") Integer page, @Param("otype") Integer otype, @Param("shopperid") Integer shopperid, @Param("agentid") Integer agentid, @Param("teamid") Integer teamid);
    int findCount(@Param("pageSize") Integer pageSize, @Param("page") Integer page, @Param("otype") Integer otype, @Param("shopperid") Integer shopperId, @Param("agentid") Integer agentid, @Param("teamid") Integer teamid);

    RunfastGoodsSellRecord get(Integer id);

    RunfastGoodsSellRecord findByShopperIdAndId(@Param("shopperid") Integer shopperid, @Param("userid") Integer userid);

    RunfastGoodsSellRecord findByShopperIdAndOrderCode(@Param("shopperid") Integer shopperid, @Param("ordercode") String ordercode);

    List<RunfastGoodsSellRecord> findById(Integer shopperid);//骑手ID查找

    RunfastGoodsSellRecord findByOrderCode(String ordercode);

 //   PageBean<RunfastGoodsSellRecord> getPageBean4Driver(@Param("pageSize") Integer pageSize, @Param("page") Integer page, @Param("otype") Integer otype, @Param("shopperid") Integer shopperId, @Param("agentid") Integer agentid, @Param("teamid") Integer teamid);

    //  pageSize, page,otype,shopperId,agentId, teamid
    RunfastGoodsSellRecord update(RunfastGoodsSellRecord record);

    List<RunfastGoodsSellRecord> findBymonth(@Param("shopperid") Integer shopperid, @Param("createTime") Date createtime,@Param("createTime1") Date createTime1);

    List<RunfastGoodsSellRecord> findBytime(@Param("createtime") Date createtime, @Param("enddate") Date enddate, @Param("shopperid") Integer shopperid, @Param("page") int page, @Param("rows") int rows, @Param("agentid") Integer agentid);
    List<RunfastGoodsSellRecord> findListPageBean(@Param("pageSize") Integer pageSize, @Param("page") Integer page, @Param("otype") Integer otype, @Param("shopperid") Integer shopperId, @Param("agentid") Integer agentid, @Param("teamid") Integer teamid);
    int findCount(@Param("pageSize") Integer pageSize, @Param("page") Integer page, @Param("otype") Integer otype, @Param("shopperid") Integer shopperId, @Param("agentid") Integer agentid, @Param("teamid") Integer teamid);

    RunfastGoodsSellRecord get(Integer id);


    List<RunfastGoodsSellRecord> findByShopperIdAndStruts(@Param("shopperid") Integer shopperid, @Param("status")Integer status);

    List<RunfastGoodsSellRecord> findByShopperIdAndStrutsAndagree1(@Param("shopperid") Integer shopperid, @Param("status")Integer status);//跑腿异常查询

    List<RunfastGoodsSellRecord> findByShopperIdAndStrutsAndagree2(@Param("shopperid") Integer shopperid, @Param("status")Integer status);//外卖异常查询

    List<Map<String,String>>  findByAgentnameAndbusinessnameAndTime(@Param("agentid") Integer agentid, @Param("name") String name, @Param("date1") Date date1,@Param("date2") Date date2, @Param("isdeliver") Integer isdeliver);

    List<Map<String,String>> findAgentnameMoney(@Param("createtime1") Date createtime1,@Param("createtime2") Date createatime2, @Param("isdeliver") Integer isdeliver);

    List<Map<String,BigDecimal>> findshopperAndCityAndtime(@Param("cityname") String cityname, @Param("shoppername") String shoppername, @Param("ceateatime1") Date ceateatime1, @Param("ceateatime2") Date ceateatime2, @Param("page")Integer page,@Param("pagesize")Integer pagesize);

    int findByShopperIdOrderCodeCount(Integer shopperid);
    int findCountShopperOrder(Integer shopperid);

    int findCountStatus9(Integer shopperid);


    List<RunfastGoodsSellRecord> findaftertime(@Param("createatime1") Date createatime1, @Param("createatime2") Date createatime2, @Param("cityname") String cityname, @Param("shoppername") String shoppername);

    List<RunfastGoodsSellRecord> finderrorOver(@Param("createatime1") Date createatime1, @Param("createatime2") Date createatime2, @Param("cityname") String cityname, @Param("shoppername") String shoppername);
    List<RunfastGoodsSellRecord> findlastscore(@Param("createatime1") Date createatime1, @Param("createatime2") Date createatime2, @Param("cityname") String cityname, @Param("shoppername") String shoppername);

    List<RunfastGoodsSellRecord> findToday(@Param("id") Integer id, @Param("date1") Date date1, @Param("date2") Date date2);
}